package com.lanju.controller;

import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lanju.service.JedisService;
import com.lanju.util.ServletUtil;
@Controller
@RequestMapping("jedis")
public class JedisController {
	
	@Resource
	JedisService jedisService;
	
	@RequestMapping("getKey")
	@ResponseBody
	public  Map<String, Object> get(HttpServletRequest request) {
		Map<String, Object> param = ServletUtil.getParameterMap(request);
		return jedisService.get("name");
	}
	@RequestMapping("hexits")
	@ResponseBody
	public Boolean hexits(HttpServletRequest request){
		Map<String, Object> param = ServletUtil.getParameterMap(request);
		return jedisService.hexists(param.get("key").toString(), param.get("fileds").toString());
	}

}
